#r "C:\\Program Files\\dotnet\\shared\\Microsoft.WindowsDesktop.App\\8.0.17\\PresentationCore.dll"
#r "C:\\Program Files\\dotnet\\shared\\Microsoft.WindowsDesktop.App\\8.0.17\\PresentationFramework.dll"
#r "C:\\Program Files\\dotnet\\shared\\Microsoft.WindowsDesktop.App\\8.0.17\\System.Xaml.dll"
#r "C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.17\WindowsBase.dll"

using System;
using System.Threading;
using System.Windows;
using System.Windows.Controls;

Thread t = new Thread(() =>
{
    var window = new Window
    {
        Title = "Hello WPF CSX",
        Width = 400,
        Height = 300
    };

    var button = new Button
    {
        Content = "Click Me",
        Width = 100,
        Height = 40,
        HorizontalAlignment = HorizontalAlignment.Center,
        VerticalAlignment = VerticalAlignment.Center
    };

    button.Click += (s, e) => MessageBox.Show("Button Clicked!");

    window.Content = button;

    var app = new Application();
    app.Run(window);
});

t.SetApartmentState(ApartmentState.STA);
t.Start();
t.Join();
